<extend name="Base:main" />
<block name="title">
<title>蔬菜外卖 - 消息管理</title>
</block>
<block name="main-content">
<div class="row">
	<div class="box col-md-12">
		<div class="box-inner">
			<div class="box-header well" data-original-title="">
				<h2>
					<i class="glyphicon glyphicon-user"></i>消息管理
				</h2>

				<div class="box-icon">
					<a href="#" class="btn btn-add btn-round btn-default"><i
						class="glyphicon glyphicon-plus"></i></a> <a href="#"
						class="btn btn-minimize btn-round btn-default"><i
						class="glyphicon glyphicon-chevron-up"></i></a> <a href="#"
						class="btn btn-close btn-round btn-default"><i
						class="glyphicon glyphicon-remove"></i></a>
				</div>
			</div>
			<div class="box-content">
				<div class="alert alert-info">对入驻信息进行查看以及管理</div>
				<form class="form-inline">
				<div class="row">
					<div class="col-xs-4 form-group">
						<label for="cdate">日期：从</label> <input type="date"
							class="form-control" id="sdate"
							onchange="javascript:getChange();" />
					</div>
					<div class="col-xs-4 form-group">
						<label for="cdate">到</label> <input type="date"
							class="form-control" id="edate"
							onchange="javascript:getChange();" />
					</div>
				</div>
				</form>
				<br/>
				<div class="loading col-sm-12 center">
					<img src="__PUBLIC__/img/ajax-loaders/ajax-loader-5.gif">
				</div>
				<table style="display: none;"
					class="table table-striped table-bordered bootstrap-datatable datatable responsive">
					<thead>
						<tr>
							<th>序号</th>
							<th>公司</th>
							<th>地址</th>
							<th>姓名</th>
							<th>电话</th>
							<th>日期</th>
							<th>时间</th>
						</tr>
					</thead>
					<tbody id="tbody">
						<foreach name="list" item="v">
						<tr>
							<td>{++$i}</a></td>
							<td>{$v.company}</td>
							<td>{$v.address}</td>
							<td>{$v.name}</td>
							<td>{$v.phone}</td>
							<td>{$v.cdate}</td>
							<td>{$v.ctime}</td>
						</tr>
						</foreach>
					</tbody>
				</table>
			</div>
			<!-- end box-content -->
		</div>
		<!-- end box-inner -->
	</div>
	<!-- end box -->
</div>
<!-- end row --> </block>
<block name="js-content"> <!-- 日期js --> <script type="text/javascript">
  var getChangeUrl = "__APP__/Admin/Enter/change";
  $(function(){
	  var sdate = "<?php echo $sdate; ?>";
	  var edate = "<?php echo $edate; ?>";
      $('#sdate').val(sdate);
      $('#edate').val(edate);
  });
  function getChange(){
	  var sdate = $("#sdate").val();
	  var edate = $("#edate").val();

      table.rows().remove();
      $.post(getChangeUrl,{sdate:sdate,edate:edate},function(data){
          	//console.log(data);
          	var count = data.length;
          	itmes = new Array(count);
          	for(i=0;i<count;i++){
              	var od = data[i];
          		itmes[i] = [(i+1),od['company'],od['address'],od['name'],od['phone'],od['cdate'],od['ctime']];
            }
          	table.rows.add(itmes).draw();
      });
  }
  </script> </block>